package bdz.projects.atwww.electrolux.ui
{
	import bdz.projects.atwww.electrolux.events.ELUIEvent;
	import bdz.projects.atwww.electrolux.model.core.ELProgram;
	import bdz.projects.atwww.electrolux.ui.core.ELCoreUI;

	public class ELOptionsControl extends ELCoreUI {
		
		protected var _currentProgramSet:ELProgram;
		protected var _optionSet:Array;
		protected var _optionReferences:Array;
		public function ELOptionsControl() {
			super(getAbstract());
		}
		protected function renderOptionItems():void{
			
		}
		protected function onOptionChanged(evt:ELUIEvent):void{
			dispatchEvent(evt);
		}
		private function clear():void{
			if(_optionReferences){
				for each(var eo:ELOptionItem in _optionReferences){
					try{
						removeChild(eo);
					}catch(e:Error){}
				}
			}
		}
		public function applyOptions(p:ELProgram):void{
			clear();
			_currentProgramSet = p;
			_optionSet = p.options;	
			renderOptionItems();
		}
		
		
	}
}